package com.xxwu.springlibrary.enums;

public enum BookStatus {
    DELETED(0, "无效"),
    NORMAL(1,"可借阅"),
    FORBIDDEN(2, "不可借阅");


    private int code;
    private String desc;
    private BookStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static BookStatus getStatuCN(int code) {
        switch (code){
            case 0: return BookStatus.DELETED;
            case 1: return BookStatus.NORMAL;
            case 2: return BookStatus.FORBIDDEN;
        }
        return BookStatus.DELETED;
    }
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
